﻿using System;
using MagistrAPI.Enums;
using MagistrAPI.MathModel;
using NUnit.Framework;

namespace TestMagistrAPI
{
    [TestFixture]
    class CharacteristicEquationsTextFixture
    {
        [Test]
        public void TestV()
        {
            var v = (Func<double[], double>)CharacteristicEquations.Characteristics[Characteristics.V];
            Assert.AreEqual(Math.Round(8.7749892512, 5), Math.Round(v(new[] {1.0, 2.0, 3.0, 4.0, 5.0, 6.0}), 5));
        }

        [Test]
        public void TestH()
        {
            var h = (Func<double[], double>)CharacteristicEquations.Characteristics[Characteristics.H];
            Assert.AreEqual(Math.Round(-6376953.2665165747, 2), Math.Round(h(new[] { 23.0, 54.0, 14.0 }), 2));
        }

        [Test]
        public void TestAl()
        {
            var al = (Func<double[], double>)CharacteristicEquations.Characteristics[Characteristics.Al];
            Assert.AreEqual(Math.Round(0.7962878085, 5), Math.Round(al(new[] { 22.0, 2.0, 23.0, 2.0, 2.0, 2.0, 0, 0, 0, 12.0, 1.0, 1.0, 1.0, 12.0, 1.0, 1.0, 1.0, 1.0 }), 5));
        }
    }
}
